package com.sright.bcard.common.service.share.enums;

/**
 * 微信推送模板
 */
public enum WechatPushTemplateEnum {

    OPENACCOUNT("openAccount" , "Oxe3M0-UjDzsj5TESPFLq1PiP-e6XSFeykIaJFJ5a2E"),
    DAYVISITOTDATA("dayVisitData", "n1j9dkKNV7_sRGNFiuEx03Y7y2vZ08MknXXkU06YVDY"),
    SERVICEEXPIRE("serviceExpire","wGs-5rtE9s66z6erEy2fBtqIntd_Ijo0pAT2l-SRX-0"),
    NEWVISITOR("newVisitor","4j90ex4T9Rf4lt3hasYN2edgNZPdu8MpAsRsZ5ar0U0")
    ;
    private String name;

    private String templateId;

    WechatPushTemplateEnum(String name, String templateId) {
        this.name = name;
        this.templateId = templateId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static WechatPushTemplateEnum getEnum(String name) {
        try {
            return valueOf(name);
        } catch (Exception e) {
            return null;
        }
    }


    public static WechatPushTemplateEnum getEnumByValue(String value) {
        if (value == null) {
            return null;
        }

        for (WechatPushTemplateEnum item : WechatPushTemplateEnum.values()) {
            if (item.getValue().equals(value)) {
                return item;
            }
        }
        return null;
    }

    public String getValue() {
        return templateId;
    }

    public void setValue(String templateId) {
        this.templateId = templateId;
    }

}
